package com.example.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;

/**
 * @author lixing
 * @date 2021/7/21 16:50
 */
@Slf4j
public class StepExecutionPartitionListener implements StepExecutionListener {
    @Override
    public void beforeStep(StepExecution stepExecution) {
        log.info("Thread Name -> [" + Thread.currentThread().getName() + "] -Step Name -> [ "
                + stepExecution.getStepName() + "] -Execute Context -> [" + stepExecution.getExecutionContext() + "]");

    }

    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        return null;
    }
}
